#!/bin/bash
# This is a  Bash shell program to show network information  
# Scriptname: netinfo.sh
ipaddress=`ip addr | grep -E 'inet (192|172|10)\.' |awk '{print $2}' |cut -d '/' -f1`
routing=`ip route | grep -E '^default via' | awk '{print $3}'`
echo "本机ip地址为：$ipaddress"
echo "路由信息为：  $routing"


